package com.jn.gsondemo.entity;

import com.google.gson.annotations.SerializedName;

import java.util.Date;

public class User {
    @SerializedName("user_name") // JSON字段映射
    private String name;

    private int age;

    private Date registerDate; // 使用自定义日期适配器

    public User(String name, int age, Date registerDate) {
        this.name = name;
        this.age = age;
        this.registerDate = registerDate;
    }

    // Getter和Setter
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Date getRegisterDate() {
        return registerDate;
    }

    public void setRegisterDate(Date registerDate) {
        this.registerDate = registerDate;
    }
}
